<template>
    <div class="home">
      <ly-tab class="fix" v-model="selectedId" :items="items" :options="options" @change="handleChange"></ly-tab>
      <router-view></router-view>
    </div>

</template>

<script>
    export default {
      name: "home",
      data(){
        return{
          selectedId:0, //选中的Id
          items:[
            {label: '热门'},
            {label: '服饰'},
            {label: '鞋包'},
            {label: '母婴'},
            {label: '百货'},
            {label: '食品'},
            {label: '内衣'},
            {label: '男装'},
            {label: '电器'}
          ],
          options:{
            activatecolor:'#e9232c'
          },
          subRouteUrl: ['/home/hot', '/home/dress', '/home/box',  '/home/general', '/home/food', '/home/shirt', '/home/man', '/home/ele','/home/mbaby']
        }
      },
      methods:{
        handleChange(item,index){
          this.$router.replace(this.subRouteUrl[index])
        }
      }
    }
</script>

<style scoped lang="stylus" ref="stylesheet/stylus">
  .home
    width 100%
    height 100%
  .fix
    position fixed
    top 0
    left 0
    z-index 998
    width 100%
</style>
